package com.itheima.zuoye.zuoye2;

import java.util.*;
import java.util.stream.Collectors;

public class Test {
    public static void main(String[] args) {
        //创建一个集合将学生对象的信息添加进去
        ArrayList<studentclass> students = new ArrayList<>();
        students.add(new studentclass(1,"张三",18));
        students.add(new studentclass(2,"李四",25));
        students.add(new studentclass(3,"王五",22));
        students.add(new studentclass(4,"赵六",26));
        students.add(new studentclass(5,"孙七",17));
        students.add(new studentclass(6,"周八",19));


        String className = "91传媒进阶";
        Map<String,List> map = new HashMap<>();
        map.put(className,students);
       map.forEach((k,v)-> System.out.println(k+"---"+v));
       System.out.println("===========================");
       //按照学生的年龄升序排序打印输出
         students.sort((a,b)->a.getSex()-b.getSex());
        map.forEach((k,v)-> System.out.println(k+"---"+v));







    }
}
